#include <iostream>
#include <cstring>
#include <vector>
#include <cmath>

using namespace std;
const int N = 25;

int t[N], d[N], l[N];
int n;
vector<int> a;
bool st[N];

bool dfs(int end)
{
	if (a.size() == n) return true;
	
	for (int i = 1; i <= n; i++)
	{
		if (st[i] == true) continue;
		
		int begin = max(end, t[i]);
		if (begin > t[i]+d[i]) continue;
		begin += l[i];
		
		a.push_back(i);
		st[i] = true;
		
		if (dfs(begin)) return true;
		
		st[i] = false;
		a.pop_back();
	}
	
	return false;
}

int main()
{
	int T; cin >> T;
	while(T--)
	{
		cin >> n;
		
		for (int i = 1; i <= n; i++) cin >> t[i] >> d[i] >> l[i];
		
		if (dfs(0)) cout << "YES" << endl;
		else cout << "NO" << endl;
		
		a.clear();
		memset(st, 0, sizeof(st));
    }
	
	return 0;
}
